<?php
/* Live language switching script */

    session_start();
    
    if($_GET['lang'] == 'en')
        $_SESSION['lang'] = 'en';
    else 
        $_SESSION['lang'] = 'de';
    
    if(isset($_GET['retpage'])) 
        $retpage = $_GET['retpage'];
    else 
        $retpage = 'index.php';
    
    if(isset($_GET['showitem']) && $_GET['showitem'] != ''){
        $returl = $retpage.'?showitem='.$_GET['showitem'];
    }
    else 
        $returl = $retpage;
    
    header('Location: '.$returl);
    exit();
?>
